<?php
include '../mysqladmin.php';
$find = $_GET['find'];
//$find = "郎云松";
if(preg_match("/^\d*$/",$find))
{
//    $code["msg"] = "是数字";
    $sql = "select * from student where sno like '%{$find}%'";
}
else {
//    $code["msg"] = "不是数字";
    $sql = "select * from student where `name` like '%{$find}%'";
}
$result = mysqli_query($link, $sql);

$code["data"]=mysqli_fetch_all($result,MYSQLI_ASSOC);
$code["status"] = true;
$code["msg"] = "查找成功";
$res = json_encode($code);
echo $res;
mysqli_close($link);

?>